home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / CCDBMS.ZIP / MUTEX.H < prev    next >
C/C++ Source or Header  |  1997-03-18  |  819b  |  33 lines

  1. // =================================================================
  2. // Mutex.h
  3. // =================================================================
  4. // Harold Kasperink / John Dekker 
  5. // Dr. Dobb's Journal 1997
  6. // =================================================================
  7. // Mutex class 
  8. // =================================================================
  9. #ifndef _MUTEX_H_
  10. #define _MUTEX_H_
  11.  
  12. // Fake thread library
  13. typedef int pthread_mutex_t;
  14.  
  15. ////////////////////////////////////////////////////////////////////
  16. // CNutex
  17. ////////////////////////////////////////////////////////////////////
  18. class CMutex 
  19. {
  20. public:
  21.         CMutex();
  22.         ~CMutex();
  23.  
  24.         void    Lock();
  25.         void    Unlock();
  26.         int     TryLock();
  27.  
  28. private:
  29.          pthread_mutex_t         m_Mutex;
  30. };
  31.  
  32. #endif
  33.